﻿using MvcSimplyCleverPart2.Properties;
using System.ComponentModel.DataAnnotations;

namespace MvcSimplyCleverPart2.Models
{
    public class AddressViewModel
    {
        [Display(Name = "Country", ResourceType = typeof(SimplyCleverResources))]
        public string CountryCode { get; set; }

        [Display(Name = "Street", ResourceType= typeof(SimplyCleverResources))]
        [Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(SimplyCleverResources))]
        public string Line1 { get; set; }

        public string Line2 { get; set; }

        [Display(Name = "City", ResourceType = typeof(SimplyCleverResources))]
        [Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(SimplyCleverResources))]
        public string City { get; set; }

        [Display(Name = "County", ResourceType = typeof(SimplyCleverResources))]
        public string County { get; set; }

        [Display(Name = "State", ResourceType = typeof(SimplyCleverResources))]
        public string StateCode { get; set; }

        [Display(Name = "ZipCode", ResourceType = typeof(SimplyCleverResources))]
        [Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(SimplyCleverResources))]
        [ZipCodeValidator("CountryCode", ErrorMessageResourceName = "ValidZipCode", ErrorMessageResourceType = typeof(SimplyCleverResources))]
        public string ZipCode { get; set; }
    }
}